package com.victor.service.impl;

import java.util.HashMap;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.victor.dao.JingqubusinessShopDao;
import com.victor.dao.JingqubusinessShopclassDao;
import com.victor.dao.Jingqubusinessshop_photoDao;
import com.victor.dao.ParameterDao;
import com.victor.dao.SpecificationsDao;
import com.victor.entity.JingqubusinessShop;
import com.victor.entity.JingqubusinessShopclass;
import com.victor.entity.Jingqubusinessshop_photo;
import com.victor.entity.Parameter;
import com.victor.entity.Specifications;
import com.victor.service.JbshopService;
@Service
public class JbshopServiceImpl implements JbshopService {
	@Autowired
	private JingqubusinessShopDao jingqubusinessshopDao;
	@Autowired
	private JingqubusinessShopclassDao shopclassDao;
	@Autowired
	private Jingqubusinessshop_photoDao photoDao;
	@Autowired
	private SpecificationsDao specificationDao;
	@Autowired
	private ParameterDao parameterDao;

	@Override
	public PageInfo<JingqubusinessShop> selAll(int page, int row,Integer jbid) {
		PageHelper.startPage(page, row);
		List<JingqubusinessShop> list = jingqubusinessshopDao.selAll(jbid);
		return new PageInfo<>(list, 5);
	}

	@Override
	public boolean update(JingqubusinessShop jingqubusinessShop) {
		return jingqubusinessshopDao.updateByPrimaryKeySelective(jingqubusinessShop);
	}

	@Override
	public JingqubusinessShop selShopById(Integer id) {
		return jingqubusinessshopDao.selectByPrimaryKey(id);
	}

	@Override
	public List<JingqubusinessShop> selByCondition(HashMap<Object, Object> hashMap) {
		return jingqubusinessshopDao.selByCondition(hashMap);
	}

	@Override
	public PageInfo<JingqubusinessShopclass> selShopclass(int page, int row) {
		PageHelper.startPage(page, row);
		List<JingqubusinessShopclass> list = shopclassDao.selClass();
		return new PageInfo<>(list, 5);
	}

	@Override
	public boolean insert(JingqubusinessShop shop) {
		return jingqubusinessshopDao.insertSelective(shop);
	}

	@Override
	public boolean insertShopphoto(Jingqubusinessshop_photo jingqubusinessshop_photo) {
		return photoDao.insertSelective(jingqubusinessshop_photo);
	}

	@Override
	public boolean insertGuige(Specifications specifications) {
		return specificationDao.insertSelective(specifications);
	}

	@Override
	public boolean insertParameter(Parameter parameter) {
		return parameterDao.insertSelective(parameter);
	}

	@Override
	public boolean updShopPhoto(Jingqubusinessshop_photo photo) {
		return photoDao.updateByPrimaryKeySelective(photo);
	}

	@Override
	public boolean updGuige(Specifications specifications) {
		return specificationDao.updateByPrimaryKeySelective(specifications);
	}

	@Override
	public boolean updParameter(Parameter parameter) {
		return parameterDao.updateByPrimaryKeySelective(parameter);
	}

	@Override
	public boolean delShop(int[] ids) {
		return jingqubusinessshopDao.deleteByPrimaryKey(ids);
	}

	@Override
	public List<JingqubusinessShop> selAllShop(String[] shopclassid) {
		return jingqubusinessshopDao.selAllShop(shopclassid);
	}
	

}
